package com.vf.admin.client.service.impl;

import com.vf.admin.client.dao.AppInvitationRecordDao;
import com.vf.admin.client.dao.AppMingxiJinbiDao;
import com.vf.admin.client.dto.AppTuanDuiDto;
import com.vf.admin.client.dto.InvitationRankDto;
import com.vf.admin.client.dto.Invite3Dto;
import com.vf.admin.client.service.AppInvitationRecordService;
import com.vf.admin.common.splitpage.SplitPageBean;
import com.vf.admin.miaodong.entity.AppInvitationRecord;
import com.vf.admin.miaodong.entity.AppMingxiJinbi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class AppInvitationRecordServiceImpl implements AppInvitationRecordService {

    @Autowired
    private AppInvitationRecordDao appInvitationRecordDao;
    @Autowired
    private AppMingxiJinbiDao appMingxiJinbiDao;

    @Override
    public List<AppInvitationRecord> findList(Map<String, Object> paraMap, SplitPageBean splitPage) {
        return appInvitationRecordDao.findList(paraMap, splitPage);
    }
    @Override
    public AppInvitationRecord get(Integer id){
        return appInvitationRecordDao.get(id);
    }
    @Override
    public AppInvitationRecord getShangji(Integer userid){
        return appInvitationRecordDao.getShangji(userid);
    }
    @Override
    public void save(AppInvitationRecord haoYou){
        appInvitationRecordDao.save(haoYou);
    }

    @Override
    public List<AppInvitationRecord> findByYaoqingList(Integer userid) {
        return appInvitationRecordDao.findByYaoqingList(userid);
    }

    @Override
    public AppInvitationRecord getJiangjin(Integer userid) {
        return appInvitationRecordDao.getJiangjin(userid);
    }

    @Override
    public List<AppTuanDuiDto> findByTuandui(Integer userid, SplitPageBean splitPageBean) {
        return appInvitationRecordDao.findByTuandui(userid,splitPageBean);
    }

    @Override
    public AppInvitationRecord selectBind(Integer userId) {
        return appInvitationRecordDao.selectBind(userId);
    }

    @Override
    public List<AppInvitationRecord> trackInviteSent(Integer status) {
        return appInvitationRecordDao.trackInviteSent(status);
    }

    @Override
    public List<Invite3Dto> invite3() {
        return appInvitationRecordDao.invite3();
    }


    /**
     * 收益明细
     * @param userId
     */
    @Override
    public List<AppMingxiJinbi> inviteDetail(Integer userId) {
        List<AppMingxiJinbi> mingxiJinbiList = appMingxiJinbiDao.inviteList(userId);
        return mingxiJinbiList;
    }

    /**
     * 我邀请的用户
     * @param userId
     * @return
     */
    @Override
    public List<AppInvitationRecord> myInviteSonUser(Integer userId) {
        return appInvitationRecordDao.findByYaoqingList(userId);
    }

    /**
     * 奖励排行
     * @return
     */
    @Override
    public List<InvitationRankDto> inviteRank() {
        return appInvitationRecordDao.inviteRank();
    }

}
